package com.catmiw.funds.domain;

import java.util.List;

public class Company implements Comparable{
	public Company(){}
	public Company(String code){
		this.code=code;
	}
	
	private String url;
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}

	private String account;
	
	public String getAccount() {
		return account;
	}
	public void setAccount(String account) {
		this.account = account;
	}

	private String code;
	private String name;
	private String fullname;
	
	private Double scale;
	
	private int rank;
	
	public int getRank() {
		return rank;
	}
	public void setRank(int rank) {
		this.rank = rank;
	}
	public Double getScale() {
		return scale;
	}
	public void setScale(Double scale) {
		this.scale = scale;
	}
	public String getFullname() {
		return fullname;
	}
	public void setFullname(String fullname) {
		this.fullname = fullname;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	private List<Fund> funds;
	
	public List<Fund> getFunds() {
		return funds;
	}
	public void setFunds(List<Fund> funds) {
		this.funds = funds;
	}
	public String toString(){
		return "["+code+","+name+","+fullname+"]";
	}
	
	public boolean equals(Object o){
		if (o==null||!(o instanceof Company))
			return false;
		return code.equals(((Company)o).getCode());
	}
	
	public int compareTo(Object arg0) {
		if (arg0==null||!(arg0 instanceof Company))
			return -1;
		Company a=(Company)arg0;
		
		return code.compareTo(a.getCode());
	}
}
